home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / examples.lha / examples / README
Encoding:
Text File  |  1991-10-23  |  4.5 KB  |  150 lines

  1. The subdirectories in this directory contain sample and test programs
  2. that exercise HDF calls.
  3.  
  4. This is NOT a test suite.  I.e. it does not systematically test all
  5. of the HDF routines.  But it exercises many of the most common
  6. routines that are used with HDF, and should give a pretty good
  7. indication of what works and what doesn'tl
  8.  
  9. Another purpose for these programs is to serve as examples of how
  10. to make HDF calls.
  11.  
  12. If you have a program that you think might be a useful addition to
  13. these, please let us know.
  14.  
  15. These programs have only been tested on the CRAY and Sun
  16. systems at NCSA, so please let us know if they reveal any
  17. bugs on your system.
  18.  
  19.  
  20. ** Makefile
  21.  
  22. Each subdirectory has its own copy of the Makefile, altered for compiling
  23. those programs that are in the subdirectory.
  24.  
  25. You should be able to compile all programs in the subdirectory by
  26. entering "make all".
  27.  
  28. After running the programs, you can clean up the directory by
  29. entering "make cleanup".
  30.  
  31. You will need to alter the following (and perhaps some others) to 
  32. conform to your own system:
  33.  
  34.     INCDIR - directory with the hdf include files
  35.     DFLIB  - path to your hdf library
  36.     CFLAGS - flags to set for your C compiler
  37.     FFLAGS - flags to set for your FORTRAN compiler
  38.     FC     - command that invokes your FORTRAN compiler
  39.  
  40.  
  41. ** General
  42.  
  43. When running the tests, name the output files o1, o2, etc.  Then
  44. when you enter "make cleanup", these files will be deleted for you.
  45.  
  46.  
  47. ** err
  48.  
  49. This simply makes sure that DFerror gets set and is accessible.
  50. Run err and errF.  They will report success or failure.
  51.  
  52. ** ris8
  53.  
  54. The programs here store and retreive 8-bit images, so it is a good
  55. idea to look at at least some of the images to make sure they
  56. are coming out right.  The README files gives details on what they
  57. do.
  58.  
  59. putim and putimF are the simplest, so run them first.  To verify
  60. their output, you need to view the images they create.
  61.  
  62. run manyRIS next.  It generates many images of different sizes and
  63. shapes, writes them, then reads them back and checks against the
  64. originals.  If this test works, then the basic RIS8 routines are
  65. probably OK.
  66.  
  67. ** sds
  68.  
  69. There are several subdirectories, plus some programs at the top
  70. level.  
  71.  
  72. At the top level, run sdsampl1F, since it checks the most basic 
  73. SDS operations.  sdsampl1F tells you if it worked or not.  
  74.  
  75. A thorough test would involve running the other program, buildsds,
  76. with many variations, but if you're short of time it's good enough 
  77. to just run it with something simple like "buildsds o1 100 100".
  78. You'll want to look at the result by downloading it and looking
  79. at the corresponding image.
  80.  
  81. At the lower levels, the main directories to go to are multi_test
  82. and slices.  In multi_test, run the one program multi_test, and
  83. it will tell you if it worked or not.  NOTE: on the Cray, multi_test
  84. doesn't work because the raw data file doesn't have 64-bit
  85. floats.
  86.  
  87. In "slices", run putslices first.  It writes data out a slice at
  88. a time, then reads it back in all at once.  It will tell you
  89. if the writing of slices was successful.  Getslices reads data
  90. in a slice at a time.  It does not (yet) check the data.  Here is
  91. what should be printed on the screen:
  92.  
  93.    =========== start here ===================
  94.        
  95.        rank=2, dimsizes=10 & 12
  96.        
  97.        
  98.        Reads in two slices from a scientific dataset.
  99.        
  100.        First slice: 4x6 array starting at (3,4):
  101.        winst=3 & 4
  102.        windims=4 & 6
  103.        
  104.             27    28    29    30    31    32
  105.             39    40    41    42    43    44
  106.             51    52    53    54    55    56
  107.             63    64    65    66    67    68
  108.        
  109.        
  110.        
  111.        Second slice: 10x2 array starting at (1,10):
  112.        winst=1 & 10
  113.        windims=10 & 2
  114.        
  115.              9    10
  116.             21    22
  117.             33    34
  118.             45    46
  119.             57    58
  120.             69    70
  121.             81    82
  122.             93    94
  123.            105   106
  124.            117   118
  125.        
  126.    ================ stop here ===================
  127.  
  128.  
  129. ** ann
  130.  
  131. Run the shell program ann.test.  Compare what is printed on the screen
  132. with the contents of ann_test_results.
  133.  
  134.  
  135. ** utils
  136.  
  137. Currently there are only two utilities here, each with its own
  138. subdirectory.  In each is a makefile that will get the files and
  139. the routine itself.
  140.  
  141. hdf24to8.  Run hdf24to8.test.  
  142. Look at the images.  (corn.r8 is rather large, so you may want 
  143. to skip it.)
  144.  
  145. r8tohdf.  Run r8tohdf.test.  
  146. Output files can be examined with hdfls to see if basic
  147. contents are there.  Display the images using any HDF
  148. 8-bit raster display tool.
  149.  
  150.